Skip to content

ci: use Ubuntu shfmt shell formatter - #2583

Merged
MikeMcC399 merged 1 commit into
nodejs:mainfrom
MikeMcC399:shfmt-ubuntu
Jul 30, 2026
Merged

ci: use Ubuntu shfmt shell formatter#2583
MikeMcC399 merged 1 commit into
nodejs:mainfrom
MikeMcC399:shfmt-ubuntu

Conversation

@MikeMcC399

Copy link
Copy Markdown
Contributor

Description

Motivation and Context

peterdavehello/shfmt:2.6.3 in .github/workflows/shfmt.yml was published in Jan 2019 and is outdated.

Ubuntu offers the package shfmt which relieves the need for a specially built Docker image to perform shell script linting in CI. It is also available in Debian. See https://github.com/mvdan/sh.

Testing Details

Locally in Ubuntu 24.04.4 LTS, execute:

sudo apt-get update
sudo apt-get install -y shfmt
shfmt -sr -i 2 -l -w -ci -d .

and confirm no error reported.

Check for success of job shfmt in workflow .github/workflows/shfmt.yml

Types of changes

  • Documentation
  • Version change (Update, remove or add more Node.js versions)
  • Variant change (Update, remove or add more variants, or versions of variants)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (none of the above)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • All new and existing tests passed.

@MikeMcC399 MikeMcC399 self-assigned this Jul 30, 2026
@MikeMcC399 MikeMcC399 added the ci CI (Continuous Integration) workflows label Jul 30, 2026
@MikeMcC399
MikeMcC399 marked this pull request as ready for review July 30, 2026 08:32
@MikeMcC399

Copy link
Copy Markdown
Contributor Author

@PeterDaveHello

Please review, as it replaces your special Docker image for checking shell scripts and uses instead the standard package from Ubuntu.

@nschonni nschonni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if pinning the install version would make sense or not. If Dependabot couldn't bump it I wouldn't bother, but if it could, then might make sense. Doesn't need to block this

@MikeMcC399

Copy link
Copy Markdown
Contributor Author

Don't know if pinning the install version would make sense or not. If Dependabot couldn't bump it I wouldn't bother, but if it could, then might make sense. Doesn't need to block this

There's an open enhancement request for Dependabot to handle OS packages, however at the moment it's not on the list of Dependabot supported ecosystems.

@MikeMcC399

Copy link
Copy Markdown
Contributor Author

I'm going to merge as-is. If we find something better later we can always update it.

@MikeMcC399
MikeMcC399 merged commit efc03ed into nodejs:main Jul 30, 2026
3 checks passed
@MikeMcC399
MikeMcC399 deleted the shfmt-ubuntu branch July 30, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI (Continuous Integration) workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated Docker image peterdavehello/shfmt:2.6.3 in shfmt.yml

2 participants